// dlg.txt

//MK Edit

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 34;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "A nearby sign identifies this valley as the Flintpit Claim. It is Haven's land, used to mine stone and jewels for the wealth and power of Haven.";
	text2 = "All is not well. The workers are not at work, getting you your stone. Instead, they are huddled around a campfire to the south. You see one soldier and a few scrawny convicts, holding daggers in their trembling hands.";
	text3 = "To the north, around the barracks and workshops, you see ka-wolves. They wander around aimlessly. They have taken away your quarry, but they aren't doing anything but hold it. They haven't wiped out your workers yet.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "The passage to the east leads to the deeper corridors of the mines. The ka-wolves have filled it with mounds of stone. It will take a lot of work to clear a path through, preferably done by convicts.";
	text2 = "They won't be able to work safely until you have cleared the upper tunnels.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0;
	text1 = "At last, you have found your convicts. They are all hiding in this chamber. Above you is a tall shaft. You can see dim sunlight far above.";
	text2 = "The convicts raise an assortment of crude weapons when they see you. Then they realize that you aren't a ka-wolf. Then they see the insignia on your shoulder and realize that you are the [P].";
	text3 = "They lower their weapons, but they look terrified. One of them walks forward, intending to speak with you.";
	code =
		sf(this_town,3,1);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0 && gf(34,11) == 0;
	text1 = "You hear the creak of a door behind you, followed by guttural grunting and chuckling. Someone has emerged from the southern hall.";
	code =
		activate_hidden_group(4);
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "__";
	code =
		sf(this_town,5,1);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0;
	text1 = "__";
	code =
		sf(this_town,6,1);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "__";
	code =
		sf(this_town,7,1);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode; 
	tag = 13;
	condition = 1;
	text1 = "This wheel is used to haul baskets of rock up from the pit. The hole is too deep and steep to climb down.";

begintalknode;
	tag = 14;
	condition = 1;
	text1 = "I am innocent!";
	text2 = "We work too hard.";
	text3 = "It's dangerous.";
	text4 = "It's so hot here!";
	text5 = "You should send me home.";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,5));
	break;

begintalknode;
	tag = 15;
	condition = 1;
	text1 = "The door is barred from the inside. When you pull on the handle, you can hear ka-wolves snickering on the other side.";

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "A massive beast lumbers out of the shadows. It's like a ka-wolf, but much larger. And dumber. And more violent. And more piggy. Back on Sacramentum, they were called mire boars.";
	text2 = "Here in the mountains of the Ro, they are called ka-boars. Different name, exactly the same pain in the neck.";

begintalknode;
	tag = 17;
	condition = 1;
	text1 = "The ka-boar tips over and collapses to the ground. The stone tiles crack under its bulk.";
	text2 = "The upper buildings of the claim have been mostly reclaimed. Your soldiers can take care of the remaining mess. Some official in Azam is sure to want to know about your victory.";
	text3 = "You notice that something fell out of the boar's mouth. You pick it up. It's a brass key.";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "This jar is full of dry, ground, orange clay. Part of your education was learning about everything that can be extracted from your vassals to enrich the Empire. You recognize this stuff as ochre, a valuable pigment.";
	text2 = "Unfortunately, this jar has been tainted with dirt and sand. It's not valuable enough to be worth your notice.";
	text3 = "It's beautiful stuff: Pure, powdery, and richly colored. Very pretty. You grab a leather pouch and take some of it with you.";
	text4 = "You've already poked at this jar. You reseal it.";
	code =
		cs();
		as(1);
		if (gf(34,9) == 0) {
			sf(34,9,1);
			inc_flag(32,14,1);
			if (gf(32,14) == 3) {
				as(3);
				set_spec_item(17,1);
				}
				else as(2);
			}
			else as(4);
	break;

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";

////Overseer Marian

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "The convicts working here are woefully underguarded. The claim is commanded by this woman. The harshness of the Low Dhaga has left her tanned and exhausted. Her hair is full of clumps of sand.";
	text2 = "When she sees the insignia on your shoulder, she leaps to attention and salutes. _This is a great honor! And a great relief! I am Overseer Marian, and I welcome you to your quarry._";
	text5 = "Overseer Marian describes the workings of the quarry to you as she watches over the convicts. You soon see why not many guards are needed. The prisoners are skinny, exhausted, and dispirited. As they should be.";
	action = INTRO;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(34,14) == 0;
	question = "_Happy to be here. What is your situation?_";
	text1 = "_Not good, I am afraid. The raids have been hard on us. The ka-wolves came in numbers, and they forced us out of the barracks. They let us stay here, so we won't lose the claim. We can't operate it, though._";
	code =
		sf(34,14,1);
	break;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(34,14) == 0;
	question = "_Are you responsible for the disaster here?_";
	text1 = "_I ... I suppose I am, [P]. I am sorry. I am in charge, so I have to take responsibility. However, the ka-wolves came here in great numbers. We couldn't fend them off._";
	text2 = "_They let us stay here, so we won't lose the claim. That is lucky._";
	code =
		sf(34,14,1);
	break;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(34,14) == 0;
	question = "_Enough talk. I need more stone._";
	text1 = "_What? Oh, yes. Of course. We have been derelict in our duties. The ka-wolves came here in great numbers. We couldn't fend them off. They took the quarry from us, and I don't have the forces to take it back._";
	text2 = "_I apologize sincerely, [P]._";
	code =
		sf(34,14,1);
	break;
	
begintalknode;
	state = 10;
	nextstate = 11;
	condition = gf(34,14) > 0;
	question = "_Tell me about this quarry._";
	text1 = "_It's one of the most productive in the southern Dhaga. Haven bought it from a failing clan three governors ago, and it has sent lots of profits back to the palace._";
	text2 = "_I jumped at the chance to command here, even though most of the workers are convicts._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_How did you come to be here?_";
	text1 = "_I served in the Gentle Coast first. Boring work. Then I served in the High Litha. Still boring, but cold too._";
	text2 = "_Governor Ivanna liked me, so she sent me here. Pay is good._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_What do the Rokaj think of us being here?_";
	text1 = "_They know how to obey a contract. They leave us alone. They'll keep leaving us alone, I imagine, until they rise up and try to kill us all._";
	text2 = "_The Dhagans don't like a woman running one of their precious quarries. Doesn't matter. This is how Haven teaches them what civilization is like._";

begintalknode;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "_All of your work is done by convicts?_";
	text1 = "_Pretty much. We hire Dhagans from time to time, the ones who will take orders from a woman. Most of the digging is done by this sorry lot, while they atone for their sins._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_What crimes did the convicts commit?_";
	text1 = "_If you ask them? None!_ She laughs.";
	text2 = "_Honestly, medium crimes. Robbery. Assault. Arson. Bad enough to spend five years in a pit, not so bad we have to execute them._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_Is this the only Haven claim that uses convicts?_";
	text1 = "_Nope. There is another in the Kranas. We have gotten good use out of our wayward citizens._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(34,14) > 0 && gf(35,12) < 3;
	question = "_My forts need more stone._";
	text1 = "She stands up straight. _You do, and we are not giving it to you. I am ashamed, [P]. Still, there is hope._";
	text2 = "_I have little authority about where the stone goes. However, if you speak with Counsel Opal in Azam, she can give the right orders to help you._";

begintalknode;
	state = 10;
	nextstate = 13;
	condition = gf(34,14) > 0 && gf(34,11) == 0;
	question = "_Tell me about your situation right now._";
	text1 = "_Well, there are ka-wolves everywhere. Maybe more. We think we've seen more beasts sneaking in late at night. Meanwhile, I am missing most of my convicts._";
	text2 = "_This could be a very productive quarry, but first we need to clean out the vermin._";
	
begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_Why haven't you killed the ka-wolves yourselves?_";
	text1 = "_Because all I have to fight with are convicts, and, well, look at them._ You do. They are not an inspiring lot of warriors.";
	text2 = "_I'm sorry, [P]. I hate to be a pitiful whiner. Still, we need help._";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_Where are our convicts?_";
	text1 = "_A few are here. Most of them, though ... Hiding. I mean, when the ka-wolves attacked, the convicts in the lower pits fled downward._";
	text2 = "_They might still be alive. We had provisions stored down there. They'll need rescue, though. After the top level is reclaimed, I mean._";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_Suppose I wanted to clear out your mines for you._";
	text1 = "_That would be a noble deed, and we could repay you with materials. [F3] is in sorry shape, last I saw. They could use our stone._";
	text2 = "_I can't send stone places, though. You will have to talk to Counsel Opal in Azam about that._";

begintalknode;
	state = 10;
	nextstate = 14;
	condition = gf(34,15) == 0 && gf(34,11) > 0;
	question = "_I cleared out the bunkhouses and upper mine._";
	text1 = "Marian is thrilled. Even the convicts seem pleased. _We will begin to reclaim the upper buildings. With the workers I have, we'll be able to ship out stone to Counsel Opal in Azam. It was an honor to see you fight, [P]._";
	text2 = "_There is another thing we need, though._";
	code =
		sf(34,15,1);
	break;
	
begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_And that is?_";
	text1 = "_We need the tunnels back, and we need all of our convicts rescued. Only then can our quarry be reclaimed._";

begintalknode;
	state = 10;
	nextstate = 15;
	condition = gf(34,15) == 1 && gf(34,13) == 0;
	question = "_The quarry is not reclaimed._";
	text1 = "_No, but it can be. There is a tunnel leading into the lower tunnels. The ka-wolves blocked it with stone, but it's nothing we can't dig out._";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = gf(34,13) == 0;
	question = "_Get to work clearing that tunnel._";
	text1 = "The convicts groan quietly. Marian says, _We'll get started! You should report your victory to Counsel Opal in Azam. By the time you are back, we'll have more good hunting for you._";

begintalknode;
	state = 10;
	nextstate = 16;
	condition = gf(34,15) == 1 && gf(34,13) > 0;
	question = "_I'm ready to reclaim the quarry._";
	text1 = "_Marvelous! We have cleared out the rubble. You can now reach the lower tunnels. Once they are free and I have my full complement of convicts, we'll send out stone by the ton!_";

begintalknode;
	state = 16;
	nextstate = -1;
	condition = 1;
	question = "_What is waiting in the lower tunnels?_";
	text1 = "_We don't know. None of us were able to sneak in. We heard a lot of snarling, though. Plenty of ka-beasts down there, I'm afraid._";

begintalknode;
	state = 16;
	nextstate = 17;
	condition = 1;
	question = "_What do I do when I find the convicts?_";
	text1 = "_I don't think you'll have to do much. They'll be scared and hungry. They'll complain a lot, sure, but they'll give in to you if you provide motivation._";

begintalknode;
	state = 17;
	nextstate = -1;
	condition = 1;
	question = "_Provide motivation?_";
	text1 = "_Be ready to threaten them. They're sure to cower before you. Threats usually do the job. I almost never have to beat them or hang them up in the hot sun._";

begintalknode;
	state = 10;
	nextstate = 18;
	condition = gf(34,15) == 1 && gf(34,12) > 0;
	question = "_The quarry has been reclaimed._";
	text1 = "_At last! You have helped us greatly, [P]. We are so grateful._";
	text2 = "_And my remaining convicts? How are they?_";
	code =
		sf(34,15,2);
	break;

begintalknode;
	state = 18;
	nextstate = -1;
	condition = gf(34,16) == 0;
	question = "_They are available for labor._";
	text1 = "_Then please report this victory to Counsel Opal. She'll make sure you get more stone._";

begintalknode;
	state = 18;
	nextstate = -1;
	condition = gf(34,16) > 0;
	question = "_They had to be killed._";
	text1 = "_Oh. Unfortunate. Please report this victory to Counsel Opal. She'll make sure you get more stone. Just not as much as you might have gotten._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(34,15) > 1;
	question = "_What is my quarry's status now?_";
	text1 = "_Fully functional. Safe from raiders. Ready to help Haven keep control of the Ro, no matter how surly our vassals get!_";

	
// Aurus

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = "You have to admire the courage of this convict. He's been down here for weeks. He's desperately hungry. He's face to face with a [P]. Yet, he looks you in the eye without a shred of fear or humility.";
	text2 = "_So. I'm Aurus, the Goldsmith's Son, and I speak for all us tunnel rats. You finally got here to rescue us then._";

begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_I have rescued you!_";
	text1 = "_So you have. You kept us roasting in the Low Dhaga for years. Then the monsters show up and you leave us to rot down here. Now you want us to work again, I'll bet._";
	text2 = "_Fine. We'll work again, [P], but only if you give us our demands._";

begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_I hope you are well._";
	text1 = "_We're not well. The Low Dhaga was already killing us slowly. Then the monsters showed up and you left us to rot down here. Now you want us to work again, I'll bet._";
	text2 = "_Fine. We'll work again, [P], but only if you give us our demands._";

begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_Get back to work, convict._";
	text1 = "Aurus doesn't flinch. Or move. _After you forgot about us down here? For weeks? Oh, no. We have some demands first, and we've earned them._";
	
begintalknode;
	state = 41;
	nextstate = -1;
	condition = 1;
	question = "_What crimes are you guilty of?_";
	text1 = "_Guilty? We're guilty of nothing. It's an injustice that we're in the Ro at all._ The convicts nod in unison.";

begintalknode;
	state = 41;
	nextstate = 42;
	condition = 1;
	question = "_I will hear your demands._";
	text1 = "_We want decent food. Longer breaks out of the sun and sand. A day off a week. The work is hard. The Low Dhaga is hard. This is more than just for all we give to you._";
	text2 = "Perhaps reasonable demands, but they will leave this mine less efficient.";
	code =
		sf(34,18,1);
		violence(-1);
	break;
	
begintalknode;
	state = 41;
	nextstate = 42;
	condition = 1;
	question = "_I don't give gifts to convicts. Get back to work._";
	text1 = "Aurus shakes his head. _You won't even hear us out? After all we do for you? For Haven? After you left us down here? That's not just, [P]._";
	code =
		violence(1);
	break;

begintalknode;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "_I refuse to negotiate with you. You will do your duty._";
	text1 = "Aurus sneers. _Duty? You didn't do your duty by us. Working us every day? Leaving no guards for when the ka-wolves showed up? Letting us sweat and starve in this pit?_";
	text2 = "_We've done more than our duty, and we deserve a tiny bit of kindness._";

begintalknode;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "_How about this? Get back to work, or I will kill you all._";
	text1 = "There is a very long, tense moment. You look Aurus in the eye. Predictably, it doesn't take too long for him to fold. His weeks in this pit have left him tired and weak.";
	text2 = "He looks away. _Not right. It's not right. Come on. At least we can sleep on the surface tonight._";
	text3 = "The demoralized convicts leave to the north.";
	action = END_TALK;
	code =
		violence(2);
		queen_faction(2);
		sf(34,12,1);
		clear_town(ME);
		erase_char(30012);
	break;
	
begintalknode;
	state = 42;
	nextstate = -1;
	condition = gf(34,18) > 0;
	question = "_I will meet your demands. Better food and more breaks._";
	text1 = "Aurus nods. _You are true and just, [P]. Much more so than we expected. We thank you._";
	text2 = "He looks away. _Come on, all of you! At least we can sleep on the surface tonight._";
	text3 = "The relieved convicts leave to the north.";
	action = END_TALK;
	code =
		queen_faction(-1);
		violence(-3);
		sf(34,12,1);
		clear_town(ME);
		erase_char(30012);
	break;

begintalknode;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "_You dare to make demands of a [P] of Haven, scum?_ Kill them.";
	text1 = "You certainly have the advantage of surprise. Aurus stumbles backward. _What? Kill us? But we can still work! I can ... Aaaah!_ He leaps back and draws a sword.";
	text2 = "The shocked convicts prepare their final, doomed defense.";
	action = END_TALK;
	code =
		sf(34,12,1);
		sf(34,16,1);
		clear_town(ME);
		set_attitude(30012,10);
	break;

//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";


//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				